inputFileName = "/home/diaosi/gov2ClearYourMindAndDoItAgain/Posting_Oriented_Training_Dataset_2013_02_22.train_tfqAdded_labelsAdded_sortedByTerm_rankInListAdded_sortedByDocID_rankInDocAdded_freqInCollectionAdded_sortedByQueryID_fixed.arff"
inputFileHandler = open(inputFileName,"r")
for i in range(0,17):
    inputFileHandler.readline()



outputFileName = "/home/diaosi/gov2ClearYourMindAndDoItAgain/Transform_traing_set_2013_02_22.arff"
outputFileHanlder = open(outputFileName,"w")

outputFileHanlder.write("@relation learning_to_prune_20130223" + "\n")
outputFileHanlder.write("@attribute queryID string" + "\n")
outputFileHanlder.write("@attribute trecID string" + "\n")
outputFileHanlder.write("@attribute term string" + "\n")
outputFileHanlder.write("@attribute partialBM25 real" + "\n")
outputFileHanlder.write("@attribute length_of_the_list real" + "\n")
outputFileHanlder.write("@attribute term_freq_in_doc real" + "\n")
outputFileHanlder.write("@attribute doc_words real" + "\n")
outputFileHanlder.write("@attribute overallBM25Score real" + "\n")
outputFileHanlder.write("@attribute term_freq_in_queries real" + "\n")
outputFileHanlder.write("@attribute posting_rank_in_list numeric" + "\n")
outputFileHanlder.write("@attribute posting_rank_in_doc numeric" + "\n")
outputFileHanlder.write("@attribute term_freq_in_collection numeric" + "\n")
outputFileHanlder.write("@attribute TOP10Label {False,True}" + "\n")
outputFileHanlder.write("@attribute TOP100Label {False,True}" + "\n")
outputFileHanlder.write("@attribute rank_in_this_results_list_for_this_query real" + "\n")
outputFileHanlder.write("@data" + "\n")

'''
# Just NOT finished and under construction
currentLine = inputFileHandler.readline()
while currentLine:
    outputFileHanlder.write(currentLine + "\n")
    currentLine = inputFileHandler.readline()
'''

inputFileHandler.close()
outputFileHanlder.close()